package com.example.superoa.model.pojos;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the salary_items database table.
 * 
 */
@Entity
@Table(name="salary_items")
@NamedQuery(name="SalaryItem.findAll", query="SELECT s FROM SalaryItem s")
public class SalaryItem implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="items_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer itemsId;

	@Column(name="items_name")
	private String itemsName;

	@Column(name="items_type")
	private String itemsType;

	@Column(name="si_remarks")
	private String siRemarks;
	
	@Column(name="si_money")
	private BigDecimal siMoney;

	public BigDecimal getSiMoney() {
		return siMoney;
	}

	public void setSiMoney(BigDecimal siMoney) {
		this.siMoney = siMoney;
	}

	//bi-directional many-to-one association to SalaryCount
	@OneToMany(mappedBy="salaryItem")
	private List<SalaryCount> salaryCounts;

	//bi-directional many-to-many association to SalaryAccout
	@ManyToMany
	@JoinTable(
		name="xingzi_xiangmu"
		, joinColumns={
			@JoinColumn(name="items_id")
			}
		, inverseJoinColumns={
			@JoinColumn(name="account_id")
			}
		)
	private List<SalaryAccout> salaryAccouts;

	public SalaryItem() {
	}

	public Integer getItemsId() {
		return this.itemsId;
	}

	public void setItemsId(Integer itemsId) {
		this.itemsId = itemsId;
	}

	public String getItemsName() {
		return this.itemsName;
	}

	public void setItemsName(String itemsName) {
		this.itemsName = itemsName;
	}

	public String getItemsType() {
		return this.itemsType;
	}

	public void setItemsType(String itemsType) {
		this.itemsType = itemsType;
	}

	public String getSiRemarks() {
		return this.siRemarks;
	}

	public void setSiRemarks(String siRemarks) {
		this.siRemarks = siRemarks;
	}

	public List<SalaryCount> getSalaryCounts() {
		return this.salaryCounts;
	}

	public void setSalaryCounts(List<SalaryCount> salaryCounts) {
		this.salaryCounts = salaryCounts;
	}

	public SalaryCount addSalaryCount(SalaryCount salaryCount) {
		getSalaryCounts().add(salaryCount);
		salaryCount.setSalaryItem(this);

		return salaryCount;
	}

	public SalaryCount removeSalaryCount(SalaryCount salaryCount) {
		getSalaryCounts().remove(salaryCount);
		salaryCount.setSalaryItem(null);

		return salaryCount;
	}

	public List<SalaryAccout> getSalaryAccouts() {
		return this.salaryAccouts;
	}

	public void setSalaryAccouts(List<SalaryAccout> salaryAccouts) {
		this.salaryAccouts = salaryAccouts;
	}

}